package com.prd.controller;

import com.prd.model.EntGoalInterview;
import com.prd.model.EntGoalSummary;
import com.prd.service.EntGoalSummaryService;
import com.prd.util.AjaxResult;
import com.prd.util.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "目标总结分析")
@RestController
@RequestMapping("/api/entGoalSummary")
public class EntGoalSummaryController extends BaseController {

    @Autowired
    private EntGoalSummaryService entGoalSummaryService;

    @ApiOperation("查询列表")
    @GetMapping("list")
    public TableDataInfo list(EntGoalSummary entGoalSummary) {
        startPage();
        List<EntGoalSummary> list = entGoalSummaryService.listInfo(entGoalSummary);
        return getDataPage(list);
    }

    @ApiOperation("添加信息")
    @PostMapping("add")
    public AjaxResult add(@RequestBody EntGoalSummary entGoalSummary) {
        return toAjax(entGoalSummaryService.insertInfo(entGoalSummary));
    }

    @ApiOperation("修改信息")
    @PostMapping("update")
    public AjaxResult update(@RequestBody EntGoalSummary entGoalSummary) {
        return toAjax(entGoalSummaryService.updateInfo(entGoalSummary));
    }

    @ApiOperation("查询详情")
    @GetMapping("details/{id}")
    public AjaxResult details(@PathVariable("id") Long id) {
        return AjaxResult.success(entGoalSummaryService.details(id));
    }
}
